package com.xzit.rcpyxt.tasks;

import com.xzit.rcpyxt.service.CourseClassService;
import com.xzit.rcpyxt.service.SignInService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Task {

    private static final Logger logger = LogManager.getLogger(Task.class);

    @Autowired
    private CourseClassService courseClassService;
    @Autowired
    private SignInService signInService;

    @Scheduled(cron = "0 0/1 * * * ?")
    private void taskCourseClass () {
        logger.info("开始执行定时器-----------生成数据------------------");
        courseClassService.timeTaskStopCourseClass();
        logger.info("定时器执行完成-----------生成数据------------------");
    }

}